acpi: Fix out of bounds access in grub_acpi_xsdt_find_table()
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 16 Oct 2024 05:20:24 +0000 (16:20 +1100)
committerFelix Zielcke <fzielcke@z-51.de>
Thu, 3 Jul 2025 16:35:51 +0000 (18:35 +0200)
commit6d724422c85be1917d56fa7f57fa9d2eb4886306
tree6feb6facb96c54d565d8b08af2f658c2020cef50
parentf78066274fd0661af96dfcafad72309b2c420667
acpi: Fix out of bounds access in grub_acpi_xsdt_find_table()

The calculation of the size of the table was incorrect (copy/pasta from
grub_acpi_rsdt_find_table() I assume...). The entries are 64-bit long.

This causes us to access beyond the end of the table which is causing
crashes during boot on some systems. Typically this is causing a crash
on VMWare when using UEFI and enabling serial autodetection, as

grub_acpi_find_table (GRUB_ACPI_SPCR_SIGNATURE);

Will goes past the end of the table (the SPCR table doesn't exits)

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Gbp-Pq: Topic upstream
Gbp-Pq: Name acpi-Fix-out-of-bounds-access-in-grub_acpi_xsdt_find_tabl.patch
grub-core/kern/acpi.c